﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AnimatorNS;

namespace LittleLove
{
    public partial class SlideShowForm : Form
    {
        public SlideShowForm(Base.PresentDB.Events _event)
        {
            InitializeComponent();
            slideShowUC1.Event = _event;
        }

        private void SlideShowForm_Load(object sender, EventArgs e)
        {
            KeyPreview = true;
        }

        #region Logic functions
        #endregion

        #region Events
        /// <summary>
        /// Close slide show when 'Esc' button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SlideShowForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                slideShowUC1.releaseSlideShow(); 
                Base.PresentDB.clearSlidesMemory();
                this.Close();
            }
        }
        #endregion
    }
}
